package com.dreamcode.caloriestracker.collectors;

import android.content.Context;
import android.graphics.Color;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;


public class SportListAdapter extends BaseAdapter{
	private String [] sportList = null;
	private Context ctx = null;
	public SportListAdapter(Context ctx, String[] sportList){
		this.ctx = ctx;
		this.sportList = sportList;
	}
	
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return sportList.length;
	}

	@Override
	public Object getItem(int pos) {
		// TODO Auto-generated method stub
		return sportList[pos];
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LinearLayout lView = new LinearLayout(ctx);
		lView.setId(position);
		/*RadioButton radioItem = new RadioButton(ctx);
		radioItem.setText((categoryList.get(position)).getGroupName());*/
		TextView tView = new TextView(ctx);
		tView.setText(sportList[position]);
		tView.setTextColor(Color.BLACK);
		tView.setMinHeight(30);
		tView.setGravity(Gravity.CENTER_VERTICAL);
		lView.addView(tView);
		return lView;
	}

}
